import React from 'react';
import {Form, Input} from 'antd';

interface AddUserFormProps {
  form: any;
}

const AddUserForm: React.FC<AddUserFormProps> = ({ form }) => {
  return (
    <Form form={form} layout="vertical" initialValues={{
      gender: 'male',
      role: 1,
      is_deleted: false
    }}>
      <Form.Item
        name="mobile"
        label="手机号"
        rules={[
          { required: true, message: '请输入手机号' },
          { pattern: /^1[3-9]\d{9}$/, message: '请输入有效的手机号' }
        ]}
      >
        <Input placeholder="请输入手机号" />
      </Form.Item>
      <Form.Item
        name="password"
        label="密码"
        rules={[
          { required: true, message: '请输入密码' },
          { min: 6, message: '密码长度至少6位' }
        ]}
      >
        <Input.Password placeholder="请输入密码" />
      </Form.Item>
    </Form>
  );
};

export default AddUserForm;